package com.center.growcenterserver.controller;

import com.center.growcenterserver.service.GradeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * 成绩控制类，用于管理员上传成绩文件
 */
@Slf4j
@RestController
@RequestMapping("/grade")
public class GradeController {

    private  GradeService gradeService;

    @PostMapping("/uploadGrades/{courseId}")
    public ResponseEntity<String> uploadFile(@RequestParam("file") MultipartFile file,
                                             @PathVariable String courseId) {
        return gradeService.uploadFile(file, courseId);
    }
}

